use std::{env, fs};

fn main() {
    let args = env::args().collect::<Vec<String>>();
    let (query, file_path) = parse_params(&args);
    println!("Searching for {}", query);
    println!("In file {}", file_path);
    let content = fs::read_to_string(&file_path)
        .expect("Something went wrong reading the file");
    println!("With text:\n{}", content);

}

fn parse_params(args: &[String]) -> (&String, &String) {
    let query = &args[1];
    let file_path = &args[2];
    (query, file_path)
}
